$(document).ready(function () {
	$(".type input[type=radio][checked=checked]").each(function () {
		var val = $(this).val();
		if (val == "reciprocal") {
			$(".reciprocal").css("display", "");
		} else {
			$(".reciprocal").css("display", "none");
		}
	});
	$(".type input[type=radio]").click(function () {
		var val = $(this).val();
		if (val == "reciprocal") {
			$(".reciprocal").css("display", "");
		} else {
			$(".reciprocal").css("display", "none");
		}
	});
	
	$(".get-info").click(function () {
		var url = server + "/get-info?url=";
		var vUrl = $(this).parent().find("input").val();
		var urlRegxp = /^(http:\/\/|https:\/\/|ftp:\/\/){1}([\w]+)(.[\w]+){1,2}$/;
		if (urlRegxp.test(vUrl) == true) {
			$.ajax({
			  url: url + vUrl,
			  dataType: "json",
			  success: function(data) {
				  $("#keywords").html(data[0]);
				  $("#metaDesc").html(data[1]);
			  }
			});
		} else {
			alert(vUrl + " is not url valid!");
		}
	});
});